package com.kitten.count.constant;

/**
 * @author kitten
 */
public class RedisKeyConstants {

    /**
     * 用户维度计数 Key 前缀
     */
    private static final String COUNT_USER_KEY_PREFIX = "count:user:";

    /**
     * Hash Field: 粉丝总数
     */
    public static final String FIELD_FANS_TOTAL = "fansTotal";
    /**
     * Hash Field: 关注总数
     */
    public static final String FIELD_FOLLOWING_TOTAL = "followingTotal";

    /**
     * 构建用户维度计数 Key
     * @param userId
     * @return
     */
    public static String buildCountUserKey(Long userId) {
        return COUNT_USER_KEY_PREFIX + userId;
    }

    // 点赞计数Key
    private static final String COUNT_NOTE_KEY_PREFIX = "count:note:";

    public static final String FIELD_LIKE_TOTAL = "likeTotal";

    public static String buildCountNoteKey(Long noteId) {
        return COUNT_NOTE_KEY_PREFIX + noteId;
    }

    // 收藏计数Key
    public static final String COUNT_NOTE_COLLECTION_KEY_PREFIX = "count:note:";

    public static final String FIELD_COLLECTION_TOTAL = "collectionTotal";

    public static String buildCountNoteCollectionKey(Long noteId) {
        return COUNT_NOTE_COLLECTION_KEY_PREFIX + noteId;
    }

    // 用户发布笔记数目 计数Key
    public static final String FIELD_NOTE_TOTAL = "noteTotal";

    // 评论计数
    private static final String COUNT_COMMENT_KEY_PREFIX = "count:comment:";
    // 子评论总数
    public static final String FIELD_CHILD_COMMENT_TOTAL = "childCommentTotal";

    public static String buildCommentCountKey(Long commentId) {
        return COUNT_COMMENT_KEY_PREFIX + commentId;
    }

}
